package com.example.dellpc.myapplication;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

/**
 * Created by 刘智强 on 2016/8/5.
 */
public class Util {
    public static void  registerReceiver(Context context,String action,BroadcastReceiver receiver){

        IntentFilter intentFilter=new IntentFilter(action);
       context. registerReceiver(receiver,intentFilter);
    }
    public static void sendBroadcastReceiver(Context context,String action){
        Intent intent=new Intent();
        intent.setAction(action);
        context.sendBroadcast(intent);
    }
}
